import { historyCarts} from "@/api/index"
const state = {
    orderLists:[]
}

const actions = {
    async orderList ({commit}) {
        // 调用接口，获取数据
        let result = await historyCarts()
        // console.log(result)
        commit('ORDERLIST',result.cart)
      
    }
}

const mutations = {
    ORDERLIST(state,orderLists) {
      state.orderLists = orderLists
    //   console.log(state.orderLists)
    }
    
}

const getters = {}

export default {
    actions,
    mutations,
    state,
    getters
}